package com.gl.order.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gl.order.entity.CustomerInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gl.order.entity.dto.CustomerPageDto;
import com.gl.order.entity.vo.CustomerCompanyVo;
import com.gl.order.entity.vo.CustomerPageVo;
import com.gl.order.entity.vo.CustomerVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 客户信息表 Mapper 接口
 * </p>
 *
 * @author lsy
 * @since 2021-06-17
 */
public interface CustomerInfoMapper extends BaseMapper<CustomerInfo> {

    @Select("SELECT ci.id,ci.name,ci.phone,ci.company FROM customer_info ci WHERE ci.id = #{id} and ci.is_delete = '0'")
    CustomerVo findById(String id);

    IPage<CustomerVo> customerPageByMarket(Page<CustomerVo> page, CustomerPageDto dto);

    IPage<CustomerPageVo> getCustomerPageData(Page<CustomerPageVo> page, String marketUser);
}
